<template>
  <div class="create-learning-task">
    <TaskCreationWizard user-type="student" @cancel="handleCancel" @submit="handleSubmit" />
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import TaskCreationWizard from '@/components/shared/Wizards/TaskCreationWizard.vue'

const router = useRouter()

const handleCancel = () => {
  router.push('/student/learning-tasks')
}

const handleSubmit = (data: any) => {
  console.log('学生端提交任务数据:', data)
  ElMessage.success('学习任务创建成功')
  // 可以在这里处理数据保存逻辑
  setTimeout(() => {
    router.push('/student/learning-tasks')
  }, 1500)
}
</script>

<style scoped>
.create-learning-task {
  height: 100%;
  background: #f7f8fa;
}
</style>